Skip to content

feat: Deprecate spec.LoadBalancerIP in favor of annotations#115

Merged
hrak merged 3 commits intodevelopfrom
feat/deprecate_loadbalancerip
Mar 3, 2026
Merged

feat: Deprecate spec.LoadBalancerIP in favor of annotations#115
hrak merged 3 commits intodevelopfrom
feat/deprecate_loadbalancerip

Conversation

@hrak
Copy link
Member

@hrak hrak commented Mar 3, 2026

Summary

  • Annotation-driven IP management: Make cloudstack-load-balancer-address annotation user-settable to request a specific IP (replacing the deprecated spec.LoadBalancerIP), and add a cloudstack-load-balancer-keep-ip annotation to retain IPs across service deletion
  • ID-based load balancer lookup: Store the public IP UUID and network UUID as service annotations (load-balancer-id, load-balancer-network-id), enabling exact ID-based lookups instead of CloudStack's unreliable keyword LIKE %keyword% matching, with automatic fallback to name-based search
  • Remove live IP reassignment: Replace the complex IP-switch-on-update code path with a clear warning event, requiring delete/recreate to change IPs — simpler and safer

Test plan

  • All existing tests pass (go test ./cloudstack/...)
  • New tests for: annotation getters, getLoadBalancerAddress precedence, getLoadBalancerByID, getLoadBalancer orchestrator (ID hit, stale fallback, no annotation, API error), keep-ip behavior in shouldReleaseLoadBalancerIP
  • go build ./... succeeds
  • golangci-lint run passes clean

🤖 Generated with Claude Code

hrak and others added 3 commits March 3, 2026 10:34
…p support

Replace deprecated spec.LoadBalancerIP with the ServiceAnnotationLoadBalancerAddress
annotation as the primary way to request a specific IP. Add ServiceAnnotationLoadBalancerKeepIP
annotation to control IP retention on service deletion (breaking change: spec.LoadBalancerIP
no longer prevents IP release).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Live IP reassignment adds significant complexity for a feature most cloud
providers don't offer. OpenStack (architecturally closest to CloudStack)
explicitly declined to implement it. Replace the IP switch branch with a
warning event telling users to delete and recreate the service instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ookup

Store the CloudStack public IP UUID and network UUID as service annotations
so that subsequent reconciliation loops can look up load balancer rules by
exact ID instead of relying on keyword-based LIKE %keyword% matching. The
new getLoadBalancer orchestrator tries ID-based lookup first and falls back
to name-based search when annotations are absent or stale.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hrak hrak merged commit 29e02a3 into develop Mar 3, 2026
1 check passed
@hrak hrak deleted the feat/deprecate_loadbalancerip branch March 3, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants